#include "TCP.h"

TCP::TCP()
{
}

void TCP::enviar(char buffer[])
{
    int n = write(sockfd,buffer,strlen(buffer));
    if (n < 0)
    {
        printf("ERROR writing to socket");
    }
}


char *TCP::recibir()
{
    char *buffer;
    int n = read(sockfd,buffer,255);
    if (n < 0)
    {
        printf("ERROR reading from socket");
    }
    return buffer;
}

int TCP::getFileDescriptor()
{
    return sockfd;
}

void TCP::setFileDescriptor(int fd)
{
    sockfd=fd;
}
